<template>
  <div class="container">
    <div class="left">
      <GPS :longitude="longitude" :latitude="latitude" style="height: 100%;"></GPS>
    </div>
    <div class="right">
      <div class="rtsp">
        <RealTimeVideo></RealTimeVideo>
      </div>
      <div class="pict">
        <PhotoGallery style="height: 100%;width: 100%;"></PhotoGallery>
      </div>
    </div>
  </div>
</template>

<script setup>
import { inject, ref, watch } from 'vue';
import GPS from '@/components/GPS/index.vue'
import RealTimeVideo from '@/components/RealTimeVideo/index.vue'
import PhotoGallery from '@/components/PhotoGallery/index.vue'
import useOperationStore from '../../../../../store/operation';
// 切换业务的数据对接处理
let operationStore=useOperationStore()
let operationId = ref(operationStore.data.length>0?operationStore.data[operationStore.index].id:'')
let latitude=ref(operationStore.data.length>0?operationStore.data[operationStore.index].latitude:null)
let longitude=ref(operationStore.data.length>0?operationStore.data[operationStore.index].longitude:null)
operationStore.$subscribe((mutation, state)=>{
  operationId.value=operationStore.data.length>0?operationStore.data[operationStore.index].id:null
  latitude.value=operationStore.data.length>0?operationStore.data[operationStore.index].latitude:null
  longitude.value=operationStore.data.length>0?operationStore.data[operationStore.index].longitude:null
})
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  height: 98%;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .left {
    width: 55%;
    height: 100%;
    margin-right: 1%;
    display: flex;
  }

  .right {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;

    .rtsp {
      width: 100%;
      height: 45%;
    }

    .pict {
      margin-top: 2%;
      width: 100%;
      height: 52%;
    }
  }
}
</style>